﻿using System;
using System.Collections.Generic;
using Calimbra.Runtime.Contracts;

namespace Calimbra.Runtime.Functions
{
    public class Determine_operation
    {
        private IDictionary<string, IOperation> operations;

        public void Process(IMessage message)
        {
            Result(new Tuple<IMessage, IOperation>(message, operations[message.Port.Fullname]));
        }

        public event Action<Tuple<IMessage, IOperation>> Result;

        public void Inject(IDictionary<string, IOperation> dependentOperations)
        {
            operations = dependentOperations;
        }
    }
}